package com.bbcare.department.plat.store.ibatis;

import java.util.List;
import java.util.Map;

import com.bbcare.department.plat.entity.OutPatientSchedule;
import com.bbcare.department.plat.entity.RandOutPatientSchedule;

public interface IOutPatientScheduleDao {

    /**
     * 通过科室ID查询 某时段排班计划 有则更新排班计划时间
     * 
     * @param id
     * @return
     */
    OutPatientSchedule selectByCondition(Map<String, String> map) throws Exception;

    /**
     * 通过ID删除排班信息
     * 
     * @param id
     * @return
     */
    int deleteyIds(List<String> ids) throws Exception;

    /**
     * 更新值班信息
     * 
     * @param account
     * @return
     */
    int update(OutPatientSchedule outPatientSchedule) throws Exception;

    /**
     * 新建医生值班信息
     * 
     * @param account
     * @return
     */
    int save(OutPatientSchedule outPatientSchedule) throws Exception;

    /**
     * 根据条件查询科室下 所有值班计划 和 医生门诊安排信息
     * 
     * @param map
     * @return
     * @throws Exception
     */
    List<Map<String, String>> selectShedulesByConditions(Map<String, Object> map) throws Exception;

    /**
     * 新增科室随访排班信息
     * 
     * @param RandOutPatientSchedule
     * @return
     */
    int saveRandOutPatientSchedule(RandOutPatientSchedule randSchedule) throws Exception;

    /**
     * 删除科室随访排班信息
     * 
     * @param id
     * @return
     */
    int deleteRandOutPatientSchedule(Map<String, Object> randMap) throws Exception;

    /**
     * 根据科室id查询科室下随访排班计划
     * 
     * @param dept_id
     * @return
     */
    List<RandOutPatientSchedule> listRandOutPatientScheduleByDept(Map<String, Object> randMap) throws Exception;

    /**
     * 查询科室下是否已经存在了随访排班计划
     * 
     * @param dept_id(科室id)、work_day(工作日)、work_period(工作时段)
     * @return
     */
    int countRandOutPatientScheduleByUnique(RandOutPatientSchedule randSchedule) throws Exception;
}
